/**
* @description: 标准化作业--作业信息-查看
* @author: wqn && yanxiaoyue
* @data:2023年6月19日 - 2023年7月11日
* @remark:
**/
<template>
  <view class="jobInfo">
    <nav-bar title="作业信息-查看" @goBack="goBack"></nav-bar>
    <form-details :distribution-data="jobInfoTop" :test-data="jobInfoBottom"></form-details>
  </view>
</template>

<script>
import navBar from "../common/navBar.vue"
import FormDetails from "../common/formDetails.vue";
import {selectworkinfo} from "../../../api/bzhzyApi.js";
export default {
  name: "jobInfoDetails",
  components: {FormDetails, navBar},
  data(){
    return{
      jobInfoTop: [
        {label: '计划作业时间', value: ''},
        {label: '责任人', value: ''},
      ],
      jobInfoBottom: [
        {label: '作业成员', value: ''},
      ],
    }
  },
  onLoad(option){
	this.work = JSON.parse(option.pushParam)
    this.getSelectworkinfo()
  },
  methods:{
    goBack() {
      uni.navigateBack()
    },
    getSelectworkinfo(){
      this.$apiRequest.bzhzyApi.selectworkinfo({
        workPlanId: this.work.id,
        consultationDeductionId: this.work.OBJID,
        pageFlag: this.work.pageFlag
      }).then(res => {
        this.jobInfoTop[0].value = res.data.workPlanStrtime  + (res.data.workPlanEndtime ?  '-' + res.data.workPlanEndtime :"");
        this.jobInfoTop[1].value = res.data.workPlanPerson;
        this.jobInfoBottom[0].value = res.data.peoplelistName3 ? res.data.peoplelistName2 + "," + res.data.peoplelistName3 : res.data.peoplelistName2
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.jobInfo{
  height: 100vh;
  background: #F2F6FA;
}
</style>